﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TireService.Data;

namespace TireService.Web.UserControls
{
    public partial class ucTireSetPatternGraph : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void callbackTireSetPatternGraphPanel_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            LoadUserControl(Convert.ToInt32(e.Parameter));
        }

        protected void LoadUserControl(int TireSetId)
        {
            TireServiceDB db = new TireServiceDB();

            wccTireSetPatternGraph.DataSource = db.GetTireSetLog(TireSetId).Where(p => p.LeftFrontTirePattern != null | p.LeftRearTirePattern != null | p.RightFrontTirePattern != null | p.RightRearTirePattern != null).ToList();
            wccTireSetPatternGraph.DataBind();
        }
    }
}